<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="keywords" content="{page_keywords}"/>
        <meta name="description" content="{page_description}"/>
        <meta name="Distribution" content="Global"/>
        <meta name="Expires" content="never"/>
        <meta http-equiv="Content-Language" content="{lang_image}" />
        <meta name="Robots" content="index,follow"/>
        <meta name="Generator" content="{hotel_domain}"/>
        <meta name="Revisit-after" content="1 days"/>
        <meta name="Author" content="{hotel_name}"/>
        <meta name="robots" content="noindex" />
        <meta name="google-site-verification" content="{google_webmaster_id}" />
        <title>{phrase var='general.title'} | {phrase var='general.protduct_title'}</title>
        <link rel="icon" href="http://localhost/magento/skin/adminhtml/default/default/favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="http://localhost/magento/skin/adminhtml/default/default/favicon.ico" type="image/x-icon" />

        <!--
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.core.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.datepicker.css" media="all" />

        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.button.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.resizable.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.dialog.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.tooltip.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.tooltip.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/jquery.ui.menu.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/public/jquery.ui.override.css" media="all" />
        
        
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/public/menu.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.core.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.widget.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.datepicker.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.button.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.draggable.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.mouse.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.position.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.resizable.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.dialog.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.tooltip.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.ui.menu.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/public/general.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/general.js"></script>
!-->

        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/public/layout.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/public/general.css"/>
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/bootstrap-responsive.css" media="all" />
        <link rel="stylesheet" type="text/css" href="{phrase var='general.host'}/static/css/bootstrap.css" media="all" />
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/jquery.min.js"></script>
        <script type='text/javascript' src="{phrase var='general.host'}/static/js/bootstrap.min.js"></script>
        <script type='text/javascript'>
            $(function() {
                $user.init();
//                        .refreshCaptcha()
//                        .refreshCaptchaEvent();

                $product.init();
            });

            var $user = {
                fields: {},
                init: function() {
                    this.login();
                    this.signup();
                    this.forgotPassword();
                    return this;
                },
                login: function() {
                    var $tags = {
                        fire: "a#login",
                        dialog: 'div#dialog_login',
                        btn_dialog: "#btn_login",
                        frm_login: '#form_login'
                    };

                    $($tags.fire).click(function($event) {
                        $event.preventDefault();
                        $($tags.dialog).modal('show');
                    });

                    $($tags.btn_dialog).click(function($event) {
                        var $option = {
                            url: $($tags.frm_login).attr('action'),
                            type: 'POST',
                            data: $($tags.frm_login).serialize(),
                            dataType: 'json',
                            success: function($data, status) {
                                if ($data.result) {
                                    location.reload();
                                }
                                //Process when login fail.
                                $user.proccessLoginFail($data);
                            }
                        };

                        $.ajax($option);
                    });

                    return this;
                },
                proccessLoginFail: function($data) {
                    if ($data.message == '') {
                        return false;
                    }

                    $('#message_login_fail').show()
                            .html($data.message)
                            .fadeOut(10000, function() {
                        $(this).html('');
                    });

                    return this;
                },
                signup: function() {
                    var $tags = {
                        fire: "a#signup",
                        dialog: 'div#dialog_register',
                        btn_dialog: "#btn_register",
                        form: '#form_register',
                        msg_success: '#message_register_success'
                    };

                    $($tags.fire).click(function($event) {
                        $event.preventDefault();
                        $($tags.dialog).modal('show');
                    });

                    $($tags.btn_dialog).click(function($event) {
                        var $option = {
                            url: $($tags.form).attr('action'),
                            type: 'POST',
                            data: $($tags.form).serialize(),
                            dataType: 'json',
                            success: function($data, status) {
                                if ($data.result) {
                                    $($tags.form).get(0).reset();
                                    $($tags.msg_success)
                                            .show()
                                            .html($data.message);
                                    setTimeout(function() {
                                        location.reload();
                                    }, 10000);
                                    return true;
                                }
//                                //Process when login fail.
                                $user.refreshCaptcha()
                                        .processRegisterFail($data.message);
                            }
                        };

                        $.ajax($option);
                    });

                    return this;
                },
                processRegisterFail: function($message) {
                    if ($message == '') {
                        return false;
                    }

                    $('#message_register_fail').show()
                            .html($message)
                            .fadeOut(60000, function() {
                        $(this).html('');
                    });

                    return this;
                },
                forgotPassword: function() {
                    var $tags = {
                        fire: "#forgot_password",
                        container: "#container_forgot_password",
                        btn_send: '#btn_send_restore_pass',
                        form: "#action_forgot_password",
                        email: '#email_forgot_password'
                    };

                    //Show container send password.
                    $($tags.fire).click(function($event) {
                        $event.preventDefault();
                        $($tags.container).toggle();
                    });

                    //Show container send password.
                    $($tags.btn_send).click(function($event) {
                        $event.preventDefault();

                        //Check email if it's empty
                        var $email = $($tags.email).val();
                        $email = $email.replace(/^\s+|\s+$/g, '');

                        if ($email == '') {
                            return false;
                        }

                        var $option = {
                            url: "<?= site_url('user/profile/requestNewPassword'); ?>",
                            type: 'POST',
                            data: {email: $($tags.email).val(), "<?= $this->config->item('csrf_token_name'); ?>": "<?= $this->security->get_csrf_hash(); ?>"},
                            dataType: 'json',
                            success: function($data, $status) {
                                if ($data.result) {
                                    $('#message_forgotpassword_fail').removeClass('alert-error')
                                            .addClass('alert-success show')
                                            .show()
                                            .html($data.message);
                                }

                                if (!$data.result) {
                                    $('#message_forgotpassword_fail').removeClass('alert-success')
                                            .addClass('alert-error show')
                                            .show()
                                            .html($data.message);
                                }
                            }
                        };

                        $.ajax($option);

                        return this;
                    });
                },
                proccessSendRestoreFail: function($data) {
                    if ($data.message == '') {
                        return false;
                    }

                    $('#message_forgot_password').show()
                            .html($data.message)
                            .fadeOut(10000, function() {
                        $(this).html('');
                    });

                    return this;
                },
                refreshCaptchaEvent: function() {
                    $('a#refresh_captcha').click(function($event) {
                        $event.preventDefault();
                        $user.refreshCaptcha();
                    });

                    return this;
                },
                refreshCaptcha: function() {
                    var $option = {
                        url: "<?= site_url('user/profile/refreshCaptcha'); ?>",
                        type: 'POST',
                        data: {"<?= $this->config->item('csrf_token_name'); ?>": "<?= $this->security->get_csrf_hash(); ?>"},
                        dataType: 'json',
                        success: function($data, $status) {
                            if ($data.result) {
                                $data = eval('(' + $data.data + ')');
                                $('div#captcha > img').remove();
                                $('div#captcha').prepend($data.image);
                            }
                        }
                    };

                    $.ajax($option);

                    return this;
                },
                forgetPassword: function() {
                    var $option = {
                        url: "<?= site_url('user/profile/requestNewPassword'); ?>",
                        type: 'POST',
                        data: {"<?= $this->config->item('csrf_token_name'); ?>": "<?= $this->security->get_csrf_hash(); ?>"},
                        dataType: 'json',
                        success: function($data, $status) {
                            if ($data.result) {
                                alert($data.data);
                                $data = eval('(' + $data.data + ')');
                                $('div#captcha > img').remove();
                                $('div#captcha').prepend($data.image);
                            }
                        }
                    };

                    $.ajax($option);

                    return this;
                }
            };

            var $product = {
                init: function() {
                    this.save();
                },
                save: function() {
                    $('a.save-product').click(function($event) {
                        $event.preventDefault();

                        var $id = $(this).prop('id').toString();
                        $id = $id.replace('save_', '');

                        var $option = {
                            url: '<?= site_url('product/product_detail/save'); ?>',
                            type: 'POST',
                            data: {id: $id, "<?= $security->token_name; ?>": "<?= $security->token; ?>"},
                            dataType: 'json',
                            success: function($data, status) {
                                if ($data.result) {
                                    $('#save_' + $data.data.id).parent().remove('span');
                                }
                            }
                        };

                        $.ajax($option);
                    });
                }
            };
        </script>
    </head>
    <body>
        <div class="body">
            <div class="header">
                <div class="float-left text-left login">
                    <a href="#">
                        <strong style="font-size: 20px;">CodeIgnitertuts</strong>
                    </a>
                </div>
                <div class="float-left text-right account">  
                    <a href="#">{phrase var='general.help'}</a><span class="separator">|</span>
                    <a id="signup" href="#">{phrase var='general.signup'}</a>
                    <span class="separator">|</span>
                    <?php if (empty($userLog)): ?>
                        <a id="login" href="#">{phrase var='general.login'}</a>
                    <?php else: ?>
                        <a id="youraccount" href="#">{phrase var='general.your_account'}</a>
                    <?php endif; ?>
                </div>
            </div>
            <!--            <div class="navbar">
                          <div class="navbar-inner">
                            <a href="#" class="brand">Title</a>
                            <ul class="nav">
                              <li class="active"><a href="#">Home</a></li>
                              <li><a href="#">Link</a></li>
                              <li><a href="#">Link</a></li>
                            </ul>
                          </div>
                        </div>-->

            <div class="content">
                <ul class="breadcrumb header-bar">
                    <li><a href="#">Home</a> <span class="divider">/</span></li>
                    <li class="active">Product</li>
                    <li class="float-right">
                        <form class="navbar-form pull-left">
                            <input type="text" class="span2" style="margin-top: 0px;background-color: #FFFFFF; border-radius: 0px;">
                                <button type="submit" class="btn" style="border: 1px solid #CCCCCC; border-radius: 0px;">Search</button>
                        </form></li>
                </ul>
                <div class="main-content">
                    <noscript>
                        <div class="noscript">
                            <div class="content">
                                <p><strong>JavaScript seems to be disabled in your browser.</strong></p>
                                <p>Please enable javascript browser to use the functionality of website.</p>
                            </div>
                        </div>
                    </noscript>

                    <div class="list-product-category">

                        <div class="pagination pagination-mini pagination-right">
                            <ul>
                                <?= $pages; ?>
                            </ul>
                        </div>
                        <div style="clear:both;"></div>
                        <div class="content-product-category">
                            <ul id="product_list">
                                <?php foreach ($list as $item): ?>
                                    <li>
                                        <div class="image">
                                            <a href="<?= site_url('product/product_detail/index/' . $item->id); ?>"><img width="71" height="107" class="book-css3-shadow" src="<?= base_url() . APPPATH . 'static/images/product/thumb/' . $item->image; ?>"></a>
                                            <p>
                                                <?php if (!empty($userLog) && $userLog->id != $item->user_saved): ?>
                                                    <span class="container-save"><a class="save-product" id="save_<?= $item->id; ?>" href="#<?= $item->id; ?>">Save</a></span>
                                                <?php endif; ?>
                                            </p>
                                        </div>
                                        <div class="description">
                                            <h4><a style="color: black;" href="#"><?= $item->name ?></a></h4>
                                            <div class="comment">
                                                <span class="view"><?= $item->total_view ?> views</span>
                                                <span class="like"><?= $item->total_like ?> likes</span>
                                            </div>
                                            <p class="introduce-book">
                                                <?= $item->summary; ?>
                                                <a href="<?= site_url('product/list_product/detail/' . $item->id); ?>">more...</a>
                                            </p>
                                            <span class="book-author"><h5><?= $item->date ?> x Comments</h5></span>
                                            <br />
                                        </div>
                                    </li>
                                <?php endforeach; ?>
                            </ul>
                        </div>
                        <div class="pagination pagination-mini pagination-right">
                            <ul>
                                <?= $pages; ?>
                            </ul>
                        </div>
                    </div>


                </div>
                <div class="right">
                    <div class="list-item">
                        <div class="header">
                            <a href="#">Bestseller</a>
                        </div>
                        <div class="box">
                            <table class="best-seller">
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java </a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="C:\Documents and Settings\MI_NAIRETAI\Desktop\Amazon.com  Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more_files\41hfCGjnp2L.jpg">
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>

                    <div class="list-item">
                        <div class="header">
                            <a href="#">Featured</a>
                        </div>
                        <div class="box">
                            <table class="best-seller">
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                                <tr>
                                    <td class="image">
                                        <a href="#">
                                            <img src="http://i3.ebkimg.com/previews/000/000275/000275563/000275563-min-1.jpg"/>
                                        </a>
                                    </td>
                                    <td class="descr">
                                        <span class="name"><a href="#">Java programming Professional</a></span><br />
                                        <span class="author">John CarySmith</span><br />
                                        <span class="price">$53.2</span><br />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>

                    <!--
                    <div class="best-seller"><a href="#" title="">Bestseller</a></div>
                    <div class="featured"><a href="#" title="">Featured</a></div>
                    -->
                </div>
            </div>
            <div class="clear-fix"></div>
            <div class="footer text-center">
                <div class="text-left">
                    <strong>CodeIgnitertus.com</strong> is a personal web, teach about codeIgniter framework
                </div>
                <div class="text-right">
                    <div class="cooperation">Tutorsell 2013@Sywogroup.com</div>
                </div>
            </div>
        </div>
        <div id="dialog_login" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">{phrase var='user.login'}</h3>
            </div>
            <div class="modal-body">
                <?= form_open(site_url('user/log/login'), 'class="bs-docs-example form-horizontal" id="form_login"'); ?>
                <div id="message_login_fail" name="message_login_fail" class="alert alert-error hide"></div>
                <div class="control-group">
                    <label for="email" class="control-label">{phrase var='user.email'}</label>
                    <div class="controls">
                        <input type="text" placeholder="Email" id="email" name="user[email]">
                    </div>
                </div>
                <div class="control-group">
                    <label for="password" class="control-label">{phrase var='user.password'}</label>
                    <div class="controls">
                        <input type="password" placeholder="Password" id="password" name="user[password]">
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <label class="checkbox">
                            <input id="remember_me" name="user[remember]" type="checkbox"> {phrase var='user.remember_me'}
                        </label>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <a id="forgot_password" href="#">{phrase var='user.forgot_your_password'}</a>
                        <br /><br />
                        <div id="message_forgotpassword_fail" name="message_forgotpassword_fail" class="alert alert-error hide"></div>
                        <div id="container_forgot_password" class="hide">
                            <input type="hidden" value="<?= site_url("user/log/forgotPassword") ?>" name="action_forgot_password" id="action_forgot_password" />
                            <input type="text" placeholder="Email" id="email_forgot_password" name="restore[email]">
                                <button id="btn_send_restore_pass" class="btn btn-primary">{phrase var='user.send'}</button>
                        </div>
                    </div>
                </div>
                <?= form_close(); ?>
            </div>
            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">{phrase var='general.close'}</button>
                <button id="btn_login" class="btn btn-primary">{phrase var='user.login'}</button>
            </div>
        </div>

        <div id="dialog_register" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h3 id="myModalLabel">{phrase var='user.register'}</h3>
            </div>
            <div class="modal-body">
                <?= form_open(site_url('user/profile/index'), 'class="bs-docs-example form-horizontal" name="form_register" id=form_register'); ?>
                <div id="message_register_fail" name="message_register_fail" class="alert alert-error hide"></div>
                <div id="message_register_success" name="message_register_success" class="alert alert-success hide"></div>
                <div class="control-group">
                    <label for="email" class="control-label">{phrase var='user.email_username'}</label>
                    <div class="controls">
                        <input type="text" id="email" placeholder="Email" name="user[email]" value="">
                    </div>
                </div>
                <div class="control-group">
                    <label for="reemail" class="control-label">{phrase var='user.Re_enter_email'}</label>
                    <div class="controls">
                        <input type="text" id="reemail" placeholder="Email" name="user[reemail]" value="">
                    </div>
                </div>
                <div class="control-group">
                    <label for="password" class="control-label">{phrase var='user.password}</label>
                    <div class="controls">
                        <input type="password" id="password" placeholder="Password" name="user[password]">
                    </div>
                </div>
                <div class="control-group">
                    <label for="repassword" class="control-label">{phrase var='user.confirm_password'}</label>
                    <div class="controls">
                        <input type="password" placeholder="Password" id="repassword" name="user[repassword]">
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls" id="captcha">

                        <a id="refresh_captcha" href="#">{phrase var='general.refresh'}</a>
                        <br />
                        <br />
                        <input type="text" placeholder="Captcha" name="user[captcha]" id="captcha" class="span2">
                    </div>
                </div>
                <?= form_close(); ?>
            </div>
            <div class="modal-footer">
                <button class="btn" data-dismiss="modal" aria-hidden="true">{phrase var='general.close'}</button>
                <button id="btn_register_reset" name="btn_register_reset" class="btn">{phrase var='user.reset'}</button>
                <button id="btn_register" name="btn_register" class="btn btn-primary">{phrase var='user.register'}</button>
            </div>
        </div>
        <!--
                
                <script type="text/javascript" src="http://s7.addthis.com/js/200/addthis_widget.js"></script>
                
                <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
                <script type="text/javascript">
                    _uacct = "{google_analytics_id}";
                    _userv=2; 
                    urchinTracker();
                </script>
                
        -->
    </body>
</html>